def fact(n):
    if n == 1:
        return 1
    return n*fact(n-1)


n = int(input(""))
fact(1) + fact(2) + ... + fact(n)